<include file="Common/header-control" />
<div class="row">
    <div class="col-md-12">
        <ul class="nav nav-tabs">
            <li><a href="{:U('control/site/common')}">站点基本信息</a></li>
            <li class="active"><a href="{:U('control/site/close')}">关闭站点</a></li>
        </ul>
    </div>
    <div class="box col-md-12">
        <div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="fa fa-edit"></i> 关闭站点</h2>
            </div>
            <div class="box-content">
                <script>
                    require(['jquery'], function($){
                        $(function(){
                            $(':radio[name="close"]').click(function(){
                                if(this.checked && $(this).val() == '1') {
                                    $('.tips-part').removeClass('hide');
                                } else {
                                    $('.tips-part').addClass('hide');
                                }
                            });
                        });
                    });
                </script>
                <form id="theform" action="" method="post" class="form-horizontal" role="form">
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 control-label">关闭状态</label>
                        <div class="col-sm-5">
                            <label class="radio-inline">
                                <if condition="empty($entity['close'])">
                                    <input type="radio" name="close" value="0" checked> 开启站点
                                    <else/>
                                    <input type="radio" name="close" value="0"> 开启站点
                                </if>
                            </label>
                            <label class="radio-inline">
                                <if condition="!empty($entity['close'])">
                                    <input type="radio" name="close" value="1" checked> 关闭站点
                                    <else/>
                                    <input type="radio" name="close" value="1"> 关闭站点
                                </if>
                            </label>
                        </div>
                    </div>
                    <div class="form-group tips-part{$entity['close'] ? '' : ' hide'}">
                        <label class="col-xs-12 col-sm-2 control-label">访问提示</label>
                        <div class="col-sm-5">
                            <textarea name="tips" class="form-control" rows="3">{$entity['tips']}</textarea>
                            <div class="help-block">站点关闭以后只能管理员访问, 这里可以指定不能访问时的站点提示</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-1">
                            <if condition="empty($entity['close'])">
                                <button type="submit" class="btn btn-block btn-primary" onclick="return confirm('确认要关闭站点吗?');">关闭站点</button>
                                <else/>
                                <button type="submit" class="btn btn-block btn-primary">打开站点</button>
                            </if>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<include file="Common/footer-control" />
